{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>仪表盘</title>
    <link href="{% static  'Dashboard/bootstrap-4.1.3-dist/css/bootstrap.min.css'%}" rel="stylesheet">
    <link href="{% static 'Dashboard/dashboard.css' %}" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
      <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">闲鱼小买卖</a>

    </nav>

    <div class="container-fluid">
      <div class="row">

        {% if new_risk_groups_were_added_yesterday %}
            <h2 style="margin: 70px 0px 10px 10px">昨日新增重点人群</h2>
            <div class="">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>学工号</th>
                                <th>姓名</th>
                                <th>单位</th>
                                <th>居住地</th>
                                <th>手机号</th>
                                <th>身体状况</th>
                                <th>家人身体状况</th>
                                <th>是否重点人群</th>
                                <th>前一日是否重点人群</th>
                                <th>亲友是否重点人群</th>
                                <th>前一天亲友是否重点人群</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for submit_time, username, name, faculty_name, current_area, sj, health_situation, family_health_situation, today_is_specific_people, yesterday_is_specific_people, today_family_is_specific_people, yesterday_family_is_specific_people in new_risk_groups_were_added_yesterday %}
                                <tr>
                                    <td>{{ username }}</td>
                                    <td>{{ name }}</td>
                                    <td>{{ faculty_name }}</td>
                                    <td>{{ current_area }}</td>
                                    <td>{{ sj }}</td>
                                    <td>{{ health_situation }}</td>
                                    <td>{{ family_health_situation }}</td>
                                    <td>{{ today_is_specific_people }}</td>
                                    <td>{{ yesterday_is_specific_people }}</td>
                                    <td>{{ today_family_is_specific_people }}</td>
                                    <td>{{ yesterday_family_is_specific_people }}</td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
        {% else %}
            <h2>昨无新增重点人员......</h2>
        {% endif %}

      </div>
    <div class="row">
        {% if people_who_have_been_unwell_for_consecutive_days %}

                <div class="">
                    <h2 style="margin: 20px 0px 10px 10px">连续5日身体不适人群</h2>
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>填报时间</th>
                                    <th>学工号</th>
                                    <th>姓名</th>
                                    <th>单位</th>
                                    <th>居住地</th>
                                    <th>手机号</th>
                                    <th>身体状况</th>

                                </tr>
                            </thead>
                            <tbody>
                                {% for submit_time, username, name, faculty_name, current_area, sj, health_situation in people_who_have_been_unwell_for_consecutive_days %}
                                    <tr>
                                        <td>{{ submit_time }}</td>
                                        <td>{{ username }}</td>
                                        <td>{{ name }}</td>
                                        <td>{{ faculty_name }}</td>
                                        <td>{{ current_area }}</td>
                                        <td>{{ sj }}</td>
                                        <td>{{ health_situation }}</td>
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>
            {% else %}
                <h2>无连续5日身体不适人群......</h2>
            {% endif %}
    </div>
    </div>



<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="{% static 'Dashboard/assets/js/vendor/jquery-slim.min.js' %}"><\/script>')</script>
<script src="{% static 'Dashboard/assets/js/vendor/popper.min.js' %}"></script>
<script src="{% static 'Dashboard/bootstrap-4.1.3-dist/js/bootstrap.min.js'%}"></script>

    <!-- Icons -->
    <script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
    <script>
      feather.replace()
    </script>

    <!-- Graphs -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
    <script>
      var ctx = document.getElementById("myChart");
      var myChart = new Chart(ctx, {
        type: 'line',
        data: {
          {% autoescape off %}
          labels: {{ last_ten_day }},
          {% endautoescape %}
          datasets: [{
             {% autoescape off %}
            data: {{ last_ten_day_count }},
              {% endautoescape %}
            lineTension: 0,
            backgroundColor: 'transparent',
            borderColor: '#007bff',
            borderWidth: 4,
            pointBackgroundColor: '#007bff'
          }]
        },
        options: {
          scales: {
            yAxes: [{
              ticks: {
                beginAtZero: false
              }
            }]
          },
          legend: {
            display: false,
          }
        }
      });
    </script>
</body>
</html>